<?php if (!defined('THINK_PATH')) exit();?><!DOCTYPE html>
<html lang="zh-cn">
<head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="renderer" content="webkit">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <title>Admin Template</title>
    <script src="/hujia/Public/static/jquery/jquery.min.js"></script>
    <link href="/hujia/Public/static/bootstrap/css/bootstrap.min.css" rel="stylesheet">
    <link href="/hujia/Public/static/font-awesome/css/font-awesome.min.css" rel="stylesheet">
    <link href="/hujia/Public/static/admin/css/layout.css" rel="stylesheet">
    <!--artDialog-->
    <link href="/hujia/Public/static/art-dialog/css/ui-dialog.css" rel="stylesheet"/>
    <script src="/hujia/Public/static/art-dialog/dist/dialog-min.js"></script>
    <!--RainJS-->
    <link href="/hujia/Public/static/pfinal/css/base.css" rel="stylesheet"/>

    <script src="/hujia/Public/static/art-dialog/dist/dialog-min.js"></script>
    <link href="/hujia/Public/static/art-dialog/css/ui-dialog.css" rel="stylesheet"/>
    <script src="/hujia/Public/static/art-dialog/dist/dialog-min.js"></script>
    <script src="/hujia/Public/static/pfinal/pfinal.js"></script>




    <style>
        .pager{height:30px;line-height:30px;font-size: 12px;margin: 25px 0px;text-align: center;color: #2E6AB1;overflow: hidden;}
        .pager a{border:1px solid #9AAFE5;color:#2E6AB1;margin:0px 5px;padding:5px 8px;text-decoration: none;}
        .pager a.hover,.pager a.active{background-color:#2E6AB1;border-color:#000080;color:#FFF;}
        .pager a.disabled{color:#C8CDD2;cursor:auto;}
    </style>


</head>
<body>
<!-- .row必须包含在 .container(固定宽度)或 .container-fluid(100% 宽度)中，以便为其赋予合适的排列(aligment)和内补(padding)-->
<nav class="layout-header">
    <div class="container layout-width">
        <div class="row">
            <div class="col-md-12">
                <div class="pull-left">
                    <a href="<?php echo U('Index/index');?>" class="logo">
                        <span class="fa fa-desktop"></span> 商户管理后台
                    </a>
                </div>
                <div class="pull-right">
                <span class="account-info">
                    <span>欢迎:<?php echo ($username); ?></span>
                     <i class="glyphicon glyphicon-print"></i>
                    <a class="login-out" href="<?php echo U('Default/logout');?>">退出</a>
                </span>
                </div>
            </div>
        </div>
    </div>
</nav>

<section class="container layout-main layout-width">
    <div class="row">
        <div class="col-md-12 display-table">

            <!--左菜单区域-->
            
                <div class="layout-menu" >
                    <ul class="main-menu">
                        <li>
                            <button style="width:100%" type="button" class="btn btn-default btn-lg js-click1">会员管理</button>
                        </li>
                        <li class="js-toggle1" >
                            <a class="menu-item" href="<?php echo U('Price/index');?>">
                                <i class="glyphicon glyphicon-time"></i>
                                <i class="icon pull-right"></i><span>报价会员</span>
                            </a>
                            <a class="menu-item" href="<?php echo U('Fast/index');?>">
                                <i class="glyphicon glyphicon-time"></i>
                                <i class="icon pull-right"></i><span>快速报价</span>
                            </a>
                            <a class="menu-item" href="<?php echo U('Fast1/index');?>">
                                <i class="glyphicon glyphicon-time"></i>
                                <i class="icon pull-right"></i><span>快速报价1</span>
                            </a>
                            <a class="menu-item" href="<?php echo U('Order/index');?>">
                                <i class="glyphicon glyphicon-time"></i>
                                <i class="icon pull-right"></i><span>预约会员</span>
                            </a>
                            <a class="menu-item" href="<?php echo U('Match/index');?>">
                                <i class="glyphicon glyphicon-time"></i>
                                <i class="icon pull-right"></i><span>匹配会员</span>
                            </a>
                        </li>

                        <li>
                            <button style="width:100%" type="button" class="btn btn-default btn-lg js-click2">设计师管理</button>
                        </li>

                        <li class="js-toggle2" style="display:none ">
                            <a class="menu-item" href="<?php echo U('Designer/index');?>">
                                <i class="glyphicon glyphicon-play-circle"></i>
                                <i class="icon pull-right"></i>
                                <span>设计师列表</span>
                            </a>
                        </li>
                        <li>
                            <button style="width:100%" type="button" class="btn btn-default btn-lg js-click3">发布管理</button>
                        </li>
                        <li class="js-toggle3" style="display:none ">
                            <a class="menu-item" href="<?php echo U('News/index');?>">
                                <i class="glyphicon glyphicon-play-circle"></i>
                                <i class="icon pull-right"></i>
                                <span>公告列表</span>
                            </a>
                        </li>
                    </ul>
                </div>
            
            <!-- 左菜单区域结束-->

            <!--右内容区域-->
            
    <div class="layout-content">

        <div class="page-title">会员管理</div>

        <div class="content-top">
            <ul class="top-nav">
                <li class="active"><span>修改信息</span></li>
            </ul>
            <div class="clearfix"></div>
        </div>
        <div class="clearfix"></div>
        <!--content-main start-->
        <div class="container-fluid content-main">
            <div class="row">
                <div class="col-md-12">
                    <div id="tsk" class="ui-tips bg-info" style="display:none">
                        <span class="icon glyphicon glyphicon-info-sign"></span> <span
                            id="ts">提示信息提示信息提示信息提示信息提示信息提示信息。</span>
                    </div>

                    <form class="col-md-offset-3 form-horizontal" onsubmit="return false">
                        <input type="hidden" value="<?php echo ($list['id']); ?>" class="js-id"/>
                        <div class="form-group">
                            <label class="col-sm-2 control-label">城市</label>
                            <div class="col-sm-5">
                                <input type="text" value="<?php echo ($list['city']); ?>" class="form-control js-city"/>
                                <span class="help-block"></span>
                            </div>
                        </div>
                        <div class="form-group">
                            <label class="col-sm-2 control-label">区域</label>
                            <div class="col-sm-5">
                                <select class="form-control js-area" name="area">
                                    <?php if(is_array($areas)): foreach($areas as $key=>$area): ?><option data-area="<?php echo ($area["id"]); ?>" value="<?php echo ($area["id"]); ?>"><?php echo ($area["name"]); ?></option><?php endforeach; endif; ?>
                                </select>
                                <span class="help-block"></span>
                            </div>
                        </div>
                        <div class="form-group">
                            <label class="col-sm-2 control-label">小区</label>
                            <div class="col-sm-5">
                                <input type="text" class="form-control js-plot" value="<?php echo ($list['plot']); ?>"/>
                                <span class="help-block"></span>
                            </div>
                        </div>
                        <div class="form-group">
                            <label class="col-sm-2 control-label">面积</label>
                            <div class="col-sm-5">
                                <input type="text" class="form-control js-place" value="<?php echo ($list['place']); ?>"/>
                                <span class="help-block"></span>
                            </div>
                        </div>
                        <div class="form-group">
                            <label class="col-sm-2 control-label">风格</label>
                            <div class="col-sm-5">
                                <select class="form-control js-style" name="style">
                                    <?php if(is_array($styles)): foreach($styles as $key=>$style): ?><option data-style="<?php echo ($style["id"]); ?>" value="<?php echo ($style["id"]); ?>"><?php echo ($style["name"]); ?></option><?php endforeach; endif; ?>
                                </select>
                                <span class="help-block"></span>
                            </div>
                        </div>
                        <div class="form-group">
                            <label class="col-sm-2 control-label">预算</label>
                            <div class="col-sm-5">
                                <input type="text" class="form-control js-butget" value="<?php echo ($list['butget']); ?>"/>
                                <span class="help-block"></span>
                            </div>
                        </div>

                        <div class="form-group">
                            <label class="col-sm-2 control-label">备注</label>
                            <div class="col-sm-5">
                                <textarea class="form-control js-remark" value="<?php echo ($list['remark']); ?>"></textarea>
                                <span class="help-block"></span>
                            </div>
                        </div>


                        <div class="form-group">
                            <div class="col-sm-offset-2 col-sm-8">
                                <button onclick="func()" style="margin-left: 90px;width: 150px" type="submit"
                                        class="btn btn-default">保存
                                </button>
                            </div>
                        </div>
                    </form>
                </div>
            </div>
        </div>
        <!--content-main end-->
    </div>
    <script>
        $(function () {
            $('option[data-area=<?php echo ($list["area_id"]); ?>]').attr("selected", true);
            $('option[data-style=<?php echo ($list["style_id"]); ?>]').attr("selected", true);
        })
        function func() {
            var city = $('.js-city').val();
            if (city == '') {
                $('#tsk').css('display', 'block');
                $('#ts').html("城市不能为空");
                return false;
            }

            var plot = $('.js-plot').val();
            if (plot == '') {
                $('#tsk').css('display', 'block');
                $('#ts').html("小区不能为空");
                return false;
            }
            //var place=$('.js-style').val()
            var butget = $('.js-butget').val();
            if (butget == '') {
                $('#tsk').css('display', 'block');
                $('#ts').html("报价不能为空");
                return false;
            }
            var place = $('.js-place').val();
            if (place == '') {
                $('#tsk').css('display', 'block');
                $('#ts').html("面积不能为空");
                return false;
            }
            var id = $('.js-id').val();
            var area = $('.js-area').val();
            var style_id=$('.js-style').val();
            var remark=$('.js-remark').val();


            //alert(area);return false;
            // alert(sex);
            // return false;
            $.ajax({
                type: 'POST',
                url: "<?php echo U('Match/doUpdate');?>",
                data: {
                    'city': city,
                    'area_id':area,
                    'plot': plot,
                    'style_id':style_id,
                    'place':place,
                    'butget':butget,
                    'remark':remark,
                    'id': id
                },
                dataType: 'json',
                success: function (data) {
                    //alert(data);
                    /* console.dir(JSON.parse(data));
                     return false;*/
                    if (data == 1) {
                        $('#tsk').css('display', 'block');
                        $('#ts').html('修改成功');
                        setTimeout(function () {
                            location.href = "<?php echo U('Match/index');?>";
                        }, 1000);
                    } else if (data == 2) {
                        $('#tsk').css('display', 'block');
                        $('#ts').html('修改失败');
                    }
                }
            })
        }
    </script>

            <!--右内容区域结束-->
            <div class="clearfix"></div>
        </div>
    </div>
</section>
<footer class="layout-footer">
    <div class="container layout-width">
        <div class="row">
            <div class="col-md-12">
                <ul class="links">
                    <li><a href="" target="_blank">关于我们</a></li>
                    <li><a href="" target="_blank">服务协议</a></li>
                    <li><a href="" target="_blank">运营规范</a></li>
                    <li><a href="" target="_blank">客服中心</a></li>
                    <li><a href="" target="_blank">在线客服</a></li>
                    <li><p class="copyright">Copyright.All Rights Reserved.</p></li>
                </ul>
            </div>
        </div>
    </div>
</footer>
<!-- HTML5 shim and Respond.js for IE8 support of HTML5 elements and media queries -->
<!-- WARNING: Respond.js doesn't work if you view the page via file:// -->
<!--[if lt IE 9]>
<script src="/hujia/Public/static/ie8/html5shiv.min.js"></script>
<script src="/hujia/Public/static/ie8/respond.min.js"></script>
<![endif]-->

<!-- jQuery (necessary for Bootstrap's JavaScript plugins) -->
<script src="/hujia/Public/static/jquery/jquery.min.js"></script>
<!-- Include all compiled plugins (below), or include individual files as needed -->
<script src="/hujia/Public/static/bootstrap/js/bootstrap.min.js"></script>

<script>
    $(function(){
        $(".js-click1").click(function(){
            /* $(".js-toggle").css("visible","show");*/
            $(".js-toggle1").toggle();
        })
        $(".js-click2").click(function(){
            /* $(".js-toggle").css("visible","show");*/
            $(".js-toggle2").toggle();
        })
        $(".js-click3").click(function(){
            /* $(".js-toggle").css("visible","show");*/
            $(".js-toggle3").toggle();
        })
    })
</script>


</body>
</html>